<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/confManager',
    'namespace' => 'Frieza\\Modules\\ConfManager\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    $router->get('/index', 'ConfManagerController@index');

    // $router->get('/edit_metaconf', 'ConfManagerController@edit_metaconf');
    //编辑元配置
    $router->get('/edit_metaconf/{project_code}/', 'ConfManagerController@edit_metaconf');
    //新建元配置
    $router->post('/save_metaconf', 'ConfManagerController@save_metaconf');
    //保存元配置
    $router->post('/save_metaconf/{project_code}', 'ConfManagerController@save_metaconf');
    $router->post('/check_metaconf/{project_code}', 'ConfManagerController@check_metaconf');
    
    //创建分群信息
    $router->get('/{project_code}/create_version', 'ConfManagerController@create_version');
    //编辑分群信息
    $router->get('/{project_code}/{version_id}/edit_version', 'ConfManagerController@edit_version');
    //编辑配置数据
    $router->get('/{project_code}/{version_id}/edit_conf', 'ConfManagerController@edit_conf');
    //
    $router->post('/{project_code}/save_version_condition', 'ConfManagerController@save_version_condition');
    $router->post('/{project_code}/save_create_conf', 'ConfManagerController@save_create_conf');
    $router->post('/{project_code}/{version_id}/save_conf', 'ConfManagerController@save_conf');
    $router->post('/{project_code}/{version_id}/check_conf', 'ConfManagerController@check_conf');
    //删除版本
    $router->get('/{project_code}/{version_id}/del_version_confirm', 'ConfManagerController@del_version_confirm');
    $router->post('/{project_code}/{version_id}/del_version', 'ConfManagerController@del_version');
    $router->get('/ad2baba', 'Ad2babaController@index');
    $router->get('/ad2baba/detail/{project_name}', 'Ad2babaController@detail');
});

// function a (){
//     throw new Exception("Error Processing Request", 1);
// }
// function b(){
    
//         a();
    
// }
// function c(){
//     try {
//         b();
//     } catch (Exception $e) {
//         var_dump($e->getMessage());
//     }
// }
// c();